﻿using System;
using System.ComponentModel;
using Loki.Utils;

namespace Luna.UI.Budget
{
    public class DisplayableBudgetLine : LunaDisplayable
    {
        #region ParentID

        private static PropertyChangedEventArgs _ParentIDChangedArgs = ObservableHelper.CreateChangedArgs<DisplayableBudgetLine>(x => x.ParentID);

        private static PropertyChangingEventArgs _ParentIDChangingArgs = ObservableHelper.CreateChangingArgs<DisplayableBudgetLine>(x => x.ParentID);

        private Guid _ParentID;

        public Guid ParentID
        {
            get
            {
                return _ParentID;
            }

            set
            {
                if (value != _ParentID)
                {
                    NotifyChanging(_ParentIDChangingArgs);
                    _ParentID = value;
                    NotifyChangedAndDirty(_ParentIDChangedArgs);
                }
            }
        }

        #endregion ParentID

        #region Code

        private static PropertyChangedEventArgs _CodeChangedArgs = ObservableHelper.CreateChangedArgs<DisplayableBudgetLine>(x => x.Code);

        private static PropertyChangingEventArgs _CodeChangingArgs = ObservableHelper.CreateChangingArgs<DisplayableBudgetLine>(x => x.Code);

        private string _Code;

        public string Code
        {
            get
            {
                return _Code;
            }

            set
            {
                if (value != _Code)
                {
                    NotifyChanging(_CodeChangingArgs);
                    _Code = value;
                    NotifyChangedAndDirty(_CodeChangedArgs);
                }
            }
        }

        #endregion Code

        #region Nom

        private static PropertyChangedEventArgs _NomChangedArgs = ObservableHelper.CreateChangedArgs<DisplayableBudgetLine>(x => x.Nom);

        private static PropertyChangingEventArgs _NomChangingArgs = ObservableHelper.CreateChangingArgs<DisplayableBudgetLine>(x => x.Nom);

        private string _Nom;

        public string Nom
        {
            get
            {
                return _Nom;
            }

            set
            {
                if (value != _Nom)
                {
                    NotifyChanging(_NomChangingArgs);
                    _Nom = value;
                    NotifyChangedAndDirty(_NomChangedArgs);
                }
            }
        }

        #endregion Nom

        #region Description

        private static PropertyChangedEventArgs _DescriptionChangedArgs = ObservableHelper.CreateChangedArgs<DisplayableBudgetLine>(x => x.Description);

        private static PropertyChangingEventArgs _DescriptionChangingArgs = ObservableHelper.CreateChangingArgs<DisplayableBudgetLine>(x => x.Description);

        private string _Description;

        public string Description
        {
            get
            {
                return _Description;
            }

            set
            {
                if (value != _Description)
                {
                    NotifyChanging(_DescriptionChangingArgs);
                    _Description = value;
                    NotifyChangedAndDirty(_DescriptionChangedArgs);
                }
            }
        }

        #endregion Description

        #region Montant

        private static PropertyChangedEventArgs _MontantChangedArgs = ObservableHelper.CreateChangedArgs<DisplayableBudgetLine>(x => x.Montant);

        private static PropertyChangingEventArgs _MontantChangingArgs = ObservableHelper.CreateChangingArgs<DisplayableBudgetLine>(x => x.Montant);

        private string _Montant;

        public string Montant
        {
            get
            {
                return _Montant;
            }

            set
            {
                if (value != _Montant)
                {
                    NotifyChanging(_MontantChangingArgs);
                    _Montant = value;
                    NotifyChangedAndDirty(_MontantChangedArgs);
                }
            }
        }

        #endregion Montant

        #region Percentage

        private static PropertyChangedEventArgs _PercentageChangedArgs = ObservableHelper.CreateChangedArgs<DisplayableBudgetLine>(x => x.Percentage);

        private static PropertyChangingEventArgs _PercentageChangingArgs = ObservableHelper.CreateChangingArgs<DisplayableBudgetLine>(x => x.Percentage);

        private string _Percentage;

        public string Percentage
        {
            get
            {
                return _Percentage;
            }

            set
            {
                if (value != _Percentage)
                {
                    NotifyChanging(_PercentageChangingArgs);
                    _Percentage = value;
                    NotifyChangedAndDirty(_PercentageChangedArgs);
                }
            }
        }

        #endregion Percentage
    }
}